
const clearTxt = (text, arr) => {

  arr.forEach(item => {
    const reg = new RegExp(item,'gi')
    text =   text.replace(reg, '');
  })
  return text;
}

console.log(clearTxt('姑娘,你他娘的问真是个人才', ['他娘的']));

function show () {
  return this.money
}

let p1 = new Object();
let p2 = new Object();
p1.money = '100';
p2.money = '200';

p1.show = show;
p2.show = show;

console.log(p1.show());
console.log(p2.show());